/**
 * 存储数据到本地
 */
let storageSet = (k,v) =>{
  try {
    wx.setStorageSync(k, v)
  } catch (error) {
    wx.msgTipAlert({title:error})
  }
}

/**
 * 从本地获取数据
 */
let  storageGet = (k) =>{
  try {
    return wx.getStorageSync(k) || ''

  } catch (error) {
    console.log(`根据${k},获取数据失败`);
  }
}

/**
 * 单个移除数据
 */
let storageRemove = (k) =>{
  try {
    wx.removeStorageSync(k)
  } catch (error) {
    console.log('删除数据失败',error);
  }
}

/**
 * 清理数据
 */
let storageClear = ()=>{
  wx.clearStorage()
}

export {storageSet,storageGet,storageRemove,storageClear}